//
//  TabBarViewController.m
//  YiTangZuoWenKe
//
//  Created by Work on 17/3/8.
//  Copyright © 2017年 Work. All rights reserved.
//tabBarVC

#import "TabBarViewController.h"
#import "HomePageViewController.h"//首页VC
#import "GuideViewController.h"//导览VC
#import "ServiceViewController.h"//服务VC
#import "MineViewController.h"//我的VC

@interface TabBarViewController ()

@end
@implementation TabBarViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    [self addChildViewController];
}
- (void)addChildViewController{
    self.viewControllers =nil;
    HomePageViewController *homePageVC = [[HomePageViewController alloc] init];
    homePageVC.title = @"首页";
    homePageVC.tabBarItem.image = [UIImage imageNamed:@"tabBarItem_Home"];
    homePageVC.tabBarItem.selectedImage = [UIImage imageNamed:@"tabBarItem_Home_S"];
    
    GuideViewController *guideVC = [[GuideViewController alloc] init];
    guideVC.title = @"导览";
    guideVC.tabBarItem.image = [UIImage imageNamed:@"tabBarItem_Guide"];
    guideVC.tabBarItem.selectedImage = [UIImage imageNamed:@"tabBarItem_Guide_S"];
    
    ServiceViewController *serviceVC = [[ServiceViewController alloc] init];
    serviceVC.title = @"服务";
    serviceVC.tabBarItem.image = [UIImage imageNamed:@"tabBarItem_Service"];
    serviceVC.tabBarItem.selectedImage = [UIImage imageNamed:@"tabBarItem_Service_S"];

    MineViewController *mineVC = [[MineViewController alloc] init];
    mineVC.title = @"我的";
    mineVC.tabBarItem.image = [UIImage imageNamed:@"tabBarItem_Mine"];
    mineVC.tabBarItem.selectedImage = [UIImage imageNamed:@"tabBarItem_Mine_S"];
    
    // 导航控制器
    UINavigationController *navC1 = [[UINavigationController alloc] initWithRootViewController:homePageVC];
    UINavigationController *navC2 = [[UINavigationController alloc] initWithRootViewController:guideVC];
    UINavigationController *navC3 = [[UINavigationController alloc] initWithRootViewController:serviceVC];
    UINavigationController *navC4 = [[UINavigationController alloc] initWithRootViewController:mineVC];
    self.viewControllers = @[navC1, navC2, navC3,navC4];
    
    //设置tabBar选中的图标的颜色
    self.tabBar.tintColor=[UIColor redColor];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    NSLog(@"内存警告");
}


@end
